package lucid.hrms.management.language;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service("LanguageService")
public class LanguageServiceImpl implements LanguageService {
	@Autowired
	private LanguageRepository languageRepository;

	@Transactional(propagation = Propagation.REQUIRED)
	public Language saveLanguage(Language language) {
		return languageRepository.merge(language);
	}

	@Transactional(readOnly = true)
	public List<Language> findLanguage(LanguageCriteria languageCriteria, int firstResult, int maxResults) {
		return languageRepository.findNationalities(languageCriteria, firstResult, maxResults);
	}

}